package br.nuticao.nutriapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class ReceitasSaudaveis extends Activity {

	String[] alimentos = { 
			"Almondegas de Soja",
			"Bolonhesa de Soja",
			"Courgettes Recheadas",
			"Frango e Salada",
			"Omelete de Espargos",
			"Penne ao Molho de Tomate",
			"Salada de Arroz" };
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_receitas_saudaveis);
		
		// Criando a listview que recebera os elementos da String
				ListView listview = (ListView) findViewById(R.id.listView1);
				ArrayAdapter<String> array = new ArrayAdapter<String>(this,
						android.R.layout.simple_list_item_checked, alimentos);

				// Listando os campos criados
				listview.setAdapter(array);

				listview.setOnItemClickListener(new OnItemClickListener() {
					@Override
					public void onItemClick(AdapterView<?> aa, View view, int p, long id) {

						//selecionando as activity
						switch (p) {
						case 0:
							Intent a0 = new Intent(ReceitasSaudaveis.this,
									AlmondegasdeSoja.class);
							startActivity(a0);

							break;
						case 1:
							Intent a1 = new Intent(ReceitasSaudaveis.this,
									BolonhesadeSoja.class);
							startActivity(a1);

							break;
						case 2:
							Intent a2 = new Intent(ReceitasSaudaveis.this,
									Courgettes_recheadas.class);
							startActivity(a2);

							break;
						case 3:
							Intent a3 = new Intent(ReceitasSaudaveis.this,
									FrangoeSalada.class);
							startActivity(a3);

							break;
						case 4:
							Intent a4 = new Intent(ReceitasSaudaveis.this,
									OmeletedeEspargos.class);
							startActivity(a4);

							break;
						case 5:
							Intent a5 = new Intent(ReceitasSaudaveis.this,
									PeneaoMolho.class);
							startActivity(a5);

							break;
						case 6:
							Intent a6 = new Intent(ReceitasSaudaveis.this,
									Saladadearroz.class);
							startActivity(a6);

							break;

						default:
							break;
						}

					}

				});
		
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.receitas_saudaveis, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
